<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible"content="IE=8"><!--以IE8模式渲染-->
	<meta http-equiv="X-UA-Compatible"content="IE=7"><!--以IE7模式渲染-->
	<meta http-equiv="X-UA-Compatible"content="IE=9; IE=8; IE=7; IE=EDGE">
	<title>员工新增</title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/demo.css">
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/jquery_city/jquery.cityselect.js"></script>

	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/long_add.css" >
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery.alert.v1.2/jquery.alert.css"/>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/autocomplete/jquery.autocomplete.css" >
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery_validate/css/validationEngine.jquery.css" >
	<!-- // <script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.0.min.js"></script> -->
	<script type="text/javascript" src="__PUBLIC__/js/jquery_validate/js/jquery.validationEngine.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/jquery_validate/js/jquery.validationEngine-zh_CN.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/jquery.alert.v1.2/jquery.easydrag.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/jquery.alert.v1.2/jquery.alert.js"></script>
	<!-- // <script type="text/javascript" src="__PUBLIC__/js/My97DatePickerBeta/WdatePicker.js"></script> -->
	<script type="text/javascript" src="__PUBLIC__/js/ajax.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/autocomplete/jquery.autocomplete.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>

	<style>
		#communication select 
		{
			width:130px;
		}
		#live select 
		{
			width:130px;
		}
		#company select 
		{
			width:130px;
		}
		#linkman select 
		{
			width:130px;
		}
	</style>
</head>

<body>
	<div style="margin:20px 0;"></div>
	<div class="easyui-tabs" data-options="tabWidth:197" id="tt">
		<div title="基本资料" style="padding:10px">
			<form action="../../facilitator/visitlog/baseinfo_submit" method="post" id="form_baseinfo">
				<input type="hidden" name="baseinfo" value="<?php echo $data; ?>">
				<h1>基本资料</h1>
				<table class="addForm" style="width:auto;">
					<tr>
						<td class="content-n">报告人：</td>
						<td class="content-d">
							<input type="text" name="author" value="<?php echo $result['author'] ?>" />
						</td>
						<td class="content-n">报告时间：</td>
						<td class="content-d">
							<?php
								if ($result['edttime']) 
								{
									$edttime = date('Y-m-d',time());
								}
								else
								{
									$edttime = $result['edttime'];
								}
							?>
							<input type="text" class="easyui-datebox" name="edttime" data-options="formatter:myformatter,parser:myparser,editable:false" value="{$edttime}">
						</td>
					</tr>
					<tr>
						<td class="content-n">商户名称：</td>
						<td class="content-d">
							<input type="text" name="merchant_name" value="<?php echo $result['merchant_name']?>" />
						</td>
						<td class="content-n">商户地址：</td>
						<td class="content-d">
							<input type="text" name="merchant_address" value="<?php echo $result['merchant_address']?>" />
						</td>
					</tr>
					<tr>
						<td class="content-n">商户简称：</td>
						<td class="content-d">
							<input type="text" name="merchant_abbreviation" value="<?php echo $result['merchant_abbreviation']?>" />
						</td>
						<td class="content-n">成立时间：</td>
						<td class="content-d">
							<?php
								if ($result['regtime']) 
								{
									$regtime = date('Y-m-d',time());
								}
								else
								{
									$regtime = $result['regtime'];
								}
							?>
							<input type="text" class="easyui-datebox" name="regtime" data-options="formatter:myformatter,parser:myparser,editable:false" value="{$regtime}">
						</td>
					</tr>
					<tr>
						<td class="content-n">商户利率：</td>
						<td class="content-d">
							<input type="text" name="interest_rate" value="<?php echo $result['interest_rate']?>" />
						</td>
						<td class="content-n">服务分类：</td>
						<td class="content-d">
							<select class="form-control" name="service_type">
								<option value="">请选择</option>
								<?php
									foreach ($array_itype as $key => $value) 
									{
										if ($value['name'] == $result['service_type']) 
										{
											echo "<option value=" . $value['name'] . " selected>" . $value['name'] . "</option>";
										}
										else
										{
											echo "<option value='".$value['name']."'>".$value['name']."</option>";
										}
									}
								?>
							</select>
						</td>
					</tr>
					<tr>
						<td class="content-n">法人：</td>
						<td class="content-d">
							<input type="text" name="corporates" value="<?php echo $result['corporates']?>" />
						</td>
						<td class="content-n">法人电话：</td>
						<td class="content-d">
							<input type="text" name="corporate_phone" value="<?php echo $result['corporate_phone']?>" />
						</td>
					</tr>
					<tr>
						<td class="content-n">法人邮箱：</td>
						<td class="content-d">
							<input type="text" name="corporate_email" value="<?php echo $result['corporate_email']?>" />
						</td>
						<td class="content-n">负责人：</td>
						<td class="content-d">
							<input type="text" name="principal" value="<?php echo $result['principal']?>" />
						</td>
					</tr>
					<tr>
						<td class="content-n">负责人电话：</td>
						<td class="content-d">
							<input type="text" name="principal_phone" value="<?php echo $result['principal_phone']?>" />
						</td>
						<td class="content-n">负责人邮箱：</td>
						<td class="content-d">
							<input type="text" name="principal_email" value="<?php echo $result['principal_email']?>" />
						</td>
					</tr>
					<tr>
						<td class="content-n">首付：</td>
						<td class="content-d">
							<input type="text" name="down_payment" value="<?php echo $result['down_payment']?>" />
						</td>
						<td class="content-n">保证金：</td>
						<td class="content-d">
							<select class="form-control" name="cash_deposit">
								<option value="">请选择</option>
								<option value="0%">0%</option>
								<option value="5%">5%</option>
								<option value="10%">10%</option>
							</select>
							<script>$("select[name='cash_deposit'] option[value='<?php echo $result["cash_deposit"];?>']").attr("selected",true);</script>
						</td>
					</tr>
					<tr>
						<td class="content-n">POS机编码：</td>
						<td class="content-d">
							<input type="text" name="pos_number" value="<?php echo $result['pos_number']?>" />
						</td>
					</tr>
					<tr>
						<td class="addButton" colspan="2">
							<input type="submit" class='save' value ="保存" >
							<input type='button' value='重置'  class='clear' onclick='window.location.reload();'>
						</td>
					</tr>
				</table>
			</form>
		</div>

		<div title="办公场地" style="padding:10px">
			<form action="../../facilitator/visitlog/office_submit" method="post" id="form_office">
				<input type="hidden" name="office" value="<?php echo $data; ?>">
				<h1>办公场地</h1>
				<table class="addForm" style="width:auto;">
					<tr>
						<td class="content-n">场地面积：</td>
						<td class="content-d">
							<select class="form-control" name="floor_space">
								<option value="">请选择(m²)</option>
								<option value="50-100">50-100</option>
								<option value="100-200">100-200</option>
								<option value="200-500">200-500</option>
								<option value="500以上">500以上</option>
							</select>
							<script>$("select[name='floor_space'] option[value='<?php echo $result["floor_space"];?>']").attr("selected",true);</script>
						</td>
						<td class="content-n">办公环境：</td>
						<td class="content-d">
							<select class="form-control" name="office_environment">
								<option value="">请选择</option>
								<option value="较差">较差</option>
								<option value="一般">一般</option>
								<option value="较好">较好</option>
							</select>
							<script>$("select[name='office_environment'] option[value='<?php echo $result["office_environment"];?>']").attr("selected",true);</script>
						</td>
					</tr>
					<tr>
						<td class="content-n">使用年限：</td>
						<td class="content-d">
							<select class="form-control" name="durable_years">
								<option value="">请选择</option>
								<option value="半年">半年</option>
								<option value="一年">一年</option>
								<option value="两年">两年</option>
								<option value="两年以上">两年以上</option>
							</select>
							<script>$("select[name='durable_years'] option[value='<?php echo $result["durable_years"];?>']").attr("selected",true);</script>
						</td>
						<td class="content-n">周边环境：</td>
						<td class="content-d">
							<select class="form-control" name="surrounding">
								<option value="">请选择</option>
								<option value="较差">较差</option>
								<option value="一般">一般</option>
								<option value="较好">较好</option>
							</select>
							<script>$("select[name='surrounding'] option[value='<?php echo $result["surrounding"];?>']").attr("selected",true);</script>
						</td>
					</tr>
					<tr>
						<td class="content-n">场地产权：</td>
						<td class="content-d">
							<select class="form-control" name="site_property">
								<option value="">请选择</option>
								<option value="租赁">租赁</option>
								<option value="自有">自有</option>
							</select>
							<script>$("select[name='site_property'] option[value='<?php echo $result["site_property"];?>']").attr("selected",true);</script>
						</td>
						<td class="content-n">营业执照：</td>
						<td class="content-d">
							<select class="form-control" name="business_license">
								<option value="">请选择</option>
								<option value="个体">个体</option>
								<option value="公司">公司</option>
							</select>
							<script>$("select[name='business_license'] option[value='<?php echo $result["business_license"];?>']").attr("selected",true);</script>
						</td>
					</tr>
					<tr>
						<td class="addButton" colspan="2">
							<input type="submit" class='save' value ="保存" >
							<input type='button' value='重置'  class='clear' onclick='window.location.reload();'>
						</td>
					</tr>
				</table>
			</form>
		</div>

		<div title="主营业务" style="padding:10px">
			<form action="../../facilitator/visitlog/business_submit" method="post" id="form_business">
				<input type="hidden" name="business" value="<?php echo $data; ?>">
				<h1>主营业务</h1>
				<table class="addForm" style="width:auto;">
					<tr>
						<td class="content-n">主营项目：</td>
						<td class="content-d">
							<input type="text" name="main_project" value="<?php echo $result['main_project'] ?>" />
						</td>
						<td class="content-n">月营业额：</td>
						<td class="content-d">
							<select class="form-control" name="average_monthly_turnover">
								<option value="">请选择</option>
								<option value="10万以下">10万以下</option>
								<option value="10-30万">10-30万</option>
								<option value="30-50万">30-50万</option>
								<option value="50-100万">50-100万</option>
								<option value="100万以上">100万以上</option>
							</select>
							<script>$("select[name='average_monthly_turnover'] option[value='<?php echo $result["average_monthly_turnover"];?>']").attr("selected",true);</script>
						</td>
					</tr>
					<tr>
						<td class="content-n">从业年限：</td>
						<td class="content-d">
							<select class="form-control" name="age_limit">
								<option value="">请选择</option>
								<option value="半年">半年</option>
								<option value="一年">一年</option>
								<option value="两年">两年</option>
								<option value="两至五年">两至五年</option>
								<option value="五年以上">五年以上</option>
							</select>
							<script>$("select[name='age_limit'] option[value='<?php echo $result["age_limit"];?>']").attr("selected",true);</script>
						</td>
						<td class="content-n">淡旺季：</td>
						<td class="content-d">
							<input type="text" name="seasonality" value="<?php echo $result['seasonality']?>" />
						</td>
					</tr>
					<tr>
						<td class="content-n">课程价格：</td>
						<td class="content-d">
							<select class="form-control" name="price">
								<option value="">请选择</option>
								<option value="低于0.5万元">低于0.5万元</option>
								<option value="0.5-1万元">0.5-1万元</option>
								<option value="1-2万元">1-2万元</option>
								<option value="2-5万元">2-5万元</option>
							</select>
							<script>$("select[name='price'] option[value='<?php echo $result["price"];?>']").attr("selected",true);</script>
						</td>
						<td class="content-n">课程周期：</td>
						<td class="content-d">
							<select class="form-control" name="period">
								<option value="">请选择</option>
								<option value="低于1个月">低于1个月</option>
								<option value="1-3个月">1-3个月</option>
								<option value="3-6个月">3-6个月</option>
								<option value="6-12个月">6-12个月</option>
								<option value="12-24个月">12-24个月</option>
								<option value="24个月以上">24个月以上</option>
							</select>
							<script>$("select[name='period'] option[value='<?php echo $result["period"];?>']").attr("selected",true);</script>
						</td>
					</tr>
					<tr>
						<td class="content-n">学生现有人数：</td>
						<td class="content-d">
							<select class="form-control" name="student_number">
								<option value="">请选择</option>
								<option value="5人">5人</option>
								<option value="5-10人">5-10人</option>
								<option value="10-20人">10-20人</option>
								<option value="20-50人">20-50人</option>
								<option value="50人以上">50人以上</option>
							</select>
							<script>$("select[name='student_number'] option[value='<?php echo $result["student_number"];?>']").attr("selected",true);</script>
						</td>
						<td class="content-n">最多接纳人数：</td>
						<td class="content-d">
							<select class="form-control" name="max_galleryful">
								<option value="">请选择</option>
								<option value="10人">10人</option>
								<option value="10-20人">10-20人</option>
								<option value="20-50人">20-50人</option>
								<option value="50人以上">50人以上</option>
							</select>
							<script>$("select[name='max_galleryful'] option[value='<?php echo $result["max_galleryful"];?>']").attr("selected",true);</script>
						</td>
					</tr>
					<tr>
						<td class="content-n">培训后工作分配：</td>
						<td class="content-d">
							<select class="form-control" name="assigning_job">
								<option value="">请选择</option>
								<option value="是">是</option>
								<option value="否">否</option>
								<option value="看情况">看情况</option>
							</select>
							<script>$("select[name='assigning_job'] option[value='<?php echo $result["assigning_job"];?>']").attr("selected",true);</script>
						</td>
						<td class="content-n">行业口碑：</td>
						<td class="content-d">
							<select class="form-control" name="reputation">
								<option value="">请选择</option>
								<option value="较差">较差</option>
								<option value="一般">一般</option>
								<option value="较好">较好</option>
							</select>
							<script>$("select[name='reputation'] option[value='<?php echo $result["reputation"];?>']").attr("selected",true);</script>
						</td>
					</tr>
					<tr>
						<td class="content-n">员工人数：</td>
						<td class="content-d">
							<select class="form-control" name="staff_number">
								<option value="">请选择</option>
								<option value="5人">5人</option>
								<option value="5-10人">5-10人</option>
								<option value="10-20人">10-20人</option>
								<option value="20-50人">20-50人</option>
								<option value="50人以上">50人以上</option>
							</select>
							<script>$("select[name='staff_number'] option[value='<?php echo $result["staff_number"];?>']").attr("selected",true);</script>
						</td>
						<td class="content-n">工作状态：</td>
						<td class="content-d">
							<select class="form-control" name="work_state">
								<option value="">请选择</option>
								<option value="忙碌">忙碌</option>
								<option value="赋闲">赋闲</option>
							</select>
							<script>$("select[name='work_state'] option[value='<?php echo $result["work_state"];?>']").attr("selected",true);</script>
						</td>
					</tr>
					<tr>
						<td class="addButton" colspan="2">
							<input type="submit" class='save' value ="保存" >
							<input type='button' value='重置'  class='clear' onclick='window.location.reload();'>
						</td>
					</tr>
				</table>
			</form>
		</div>

		<div title="支出估计" style="padding:10px">
			<form action="../../facilitator/visitlog/expenses_submit" method="post" id="form_expenses">
				<input type="hidden" name="expenses" value="<?php echo $data; ?>">
				<h1>支出估计</h1>
				<table class="addForm" style="width:auto;">
					<tr>
						<td class="content-n">员工工资：</td>
						<td class="content-d">
							<input type="text" name="staff_wages" value="<?php echo $result['staff_wages'] ?>" />
						</td>
						<td class="content-n">租金水电：</td>
						<td class="content-d">
							<input type="text" name="utility_bills" value="<?php echo $result['utility_bills'] ?>" />
						</td>
					</tr>
					<tr>
						<td class="content-n">负债：</td>
						<td class="content-d">
							<input type="text" name="liabilities" value="<?php echo $result['liabilities']?>" />
						</td>
						<td class="content-n">其他：</td>
						<td class="content-d">
							<input type="text" name="rests_cost" value="<?php echo $result['rests_cost']?>" />
						</td>
					</tr>
					<tr>
						<td class="addButton" colspan="2">
							<input type="submit" class='save' value ="保存" >
							<input type='button' value='重置'  class='clear' onclick='window.location.reload();'>
						</td>
					</tr>
				</table>
			</form>
		</div>

		<div title="提醒注意事项" style="padding:10px">
			<form action="../../facilitator/visitlog/notice_submit" method="post" id="form_notice" enctype="multipart/form-data">
				<input type="hidden" name="notice" value="<?php echo $data; ?>">
				<h1>提醒注意事项 & 文件上传</h1>
				<table class="addForm" style="width:auto;">
					<tr>
						<td class="content-n">商户简介：</td>
						<td class="content-d">
							<input type="text" name="shops" value="<?php echo $result['shops']?>" />
						</td>
					</tr>
					<tr>
						<td class="content-n">商户提交资料：</td>
						<td class="content-d">
							营业执照,租赁合同,租金收据,征信报告,银行流水,合同资料
						</td>
					</tr>
					<tr>
						<td class="content-n">其他注意事项：</td>
						<td class="content-d">
							1,一段时期内，一个商户学员申请激增或者申请人与行业年龄阶层不符，注意骗贷行为。2,商户照片。
						</td>
					</tr>

					<tr>
						<td class="content-n">文件上传：</td>
						<td class="content-d">
							<input type='file' name='files'>
						</td>
					</tr>
					<?php
						if ($files) 
						{
					?>
					<tr>
						<td class="content-n">已上传文件：</td>
						<td class="content-d">
							<?php
								foreach ($files as $key => $value) 
								{
									$array_file = explode('.',$value['file_address']);
							?>
							<input name="files_address" readonly value="<?php echo $value['file_address'];?>" type="text">
							<input type="button" value ="查看" onclick="see_file('<?php echo $array_file[0];?>','<?php echo $array_file[1];?>')">
							<input type="button" value ="删除" onclick="del_file(<?php echo $value['file_id']; ?>);"><br><br>
							<?php
								}
							?>
						</td>
					</tr>
					<?php
						}
					?>

					<tr>
						<td class="addButton" colspan="2">
							<input type="submit" class='save' value ="保存" >
							<input type='button' value='重置'  class='clear' onclick='window.location.reload();'>
						</td>
					</tr>
				</table>
			</form>
		</div>

		<!-- <div title="文件上传" style="padding:10px">
			<form action="../../facilitator/visitlog/file_submit" method="post" id="form_file" enctype="multipart/form-data">
				<input type="hidden" name="file" value="<?php echo $data; ?>">
				<h1>文件上传</h1>
				<table class="addForm" style="width:auto;">
					<tr>
						<td class="content-n">文件上传：</td>
						<td class="content-d">
							<input type='file' name='files'>
						</td>
					</tr>
					<?php
						if ($files) 
						{
					?>
					<tr>
						<td class="content-n">已上传文件：</td>
						<td class="content-d">
							<?php
								foreach ($files as $key => $value) 
								{
									$array_file = explode('.',$value['file_address']);
							?>
							<input name="files_address" readonly value="<?php echo $value['file_address'];?>" type="text">
							<input type="button" value ="查看" onclick="see_file('<?php echo $array_file[0];?>','<?php echo $array_file[1];?>')">
							<input type="button" value ="删除" onclick="del_file(<?php echo $value['file_id']; ?>);"><br><br>
							<?php
								}
							?>
						</td>
					</tr>
					<?php
						}
					?>
					<tr>
						<td class="addButton" colspan="2">
							<input type="submit" class='save' value ="保存" >
							<input type='button' value='重置'  class='clear' onclick='window.location.reload();'>
						</td>
					</tr>
				</table>
			</form>
		</div> -->
	</div>

	<script type="text/javascript">
		$(function() 
		{
			var tabs = $('#tt').tabs().tabs('tabs');
			for(var i=0; i<tabs.length; i++) 
			{
				tabs[i].panel('options').tab.unbind().bind('mouseenter',{index:i},function(e) 
				{
					$('#tt').tabs('select', e.data.index);
				});
			}
		});

		//	查看文件动作
		function see_file(file_address1,file_address2) 
		{
			window.open("http://<?php echo $_SERVER['HTTP_HOST'] ?>/tp_bypal/Public/upload/visitlog/"+file_address1+"."+file_address2);
			// window.open("http://www.baidu.com");
		}

		//	删除动作
		function del_file(file_id) 
		{
			var msg = "您确定删除该文件吗？\n\n请确认！";
			if (confirm(msg)==true) 
			{
				var url = "../../facilitator/visitlog/del_file";
				$.ajax({
					type: "POST",
					async: true,
					data: {"delData":file_id},
					url: url,
					success: function(d) 
					{
						if (d == 1) 
						{
							window.location.reload();
						}
						else
						{
							alert('操作失败，请尝试重新操作或联系管理员！');
							window.history.back(); 
						}
					},
					error: function(e) 
					{
						alert(e);
					}
				});
			}
			else
			{
				return false;
			}
		}
	</script>
</body>
</html>